package com.example.demolib.entity;


import lombok.Data;

@Data
public class Result<T> {

    private Integer status;
    private String errorMessage;
    private T data;

    public static <T> Result<T> success(T data){
        Result<T> result = new Result<>();
        result.setStatus(200);
        result.setData(data);
        return result;
    }

    public static <T> Result<T> fail(String errorMessage){
        Result<T> result = new Result<>();
        result.setStatus(401);
        result.setErrorMessage(errorMessage);
        return result;
    }


}
